<template>
  <div>
    <hr>
    <p>------这是子组件------- {{ value }}</p>
    <button @click="add">加一</button>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Number,
      required: true
    }
  },
  methods: {
    add() {
      this.$emit('input', this.value + 1)
    }
  }

}
</script>

<style>

</style>
